/**
 * 菜单快捷访问自定义字段
 * 
 * @author 艾格林门信息服务（大连）有限公司
 * @copyright 2015 - present
 * @license GPL v3
 */
PCL.define("PSI.MainMenu.Shortcut.Field", {
  extend: "Ext.form.field.Picker",
  alias: "widget.psi_mainmenushortcutfield_v2",

  /**
   * @override
   */
  initComponent() {
    const me = this;

    PCL.apply(me, {
      matchFieldWidth: false,
    });

    me.__idValue = null;

    me.callParent(arguments);
  },

  /**
   * @override
   */
  createPicker() {
    const me = this;

    return new PSI.MainMenu.Shortcut.Picker({
      pickerField: me,
      renderTo: document.body,
      floating: true,
      hidden: true,
      focusOnShow: true,
      keyNavConfig: {
        esc() {
          me.collapse();
        }
      }
    });
  },

  /**
   * @override
   */
  onCollapse() {
    this.focus(false, 60);
  },

});
